🔤 Change App Font
Customize your app's typography by integrating Google Fonts to match your brand's visual identity.
📋 Overview
The eSchool app uses Google Fonts for flexible and beautiful typography. You can easily change the app's font family by selecting any font from Google Fonts and updating a single configuration file.
🔄 Steps to Change Font
Step 1: Choose Your Google Font
- Visit Google Fonts
- Browse and select your desired font family
- Note the exact font family name (e.g., "Roboto", "Poppins", "Open Sans")
Step 2: Update Font Configuration
The font files are bundled with the app, in the google_fonts/ folder at the root of the project.
- On Google Fonts, click Get font → Download all for your font family and unzip it.
- Copy its
.ttffiles and its licence file (OFL.txt) intogoogle_fonts/. - Delete the
Poppins-*.ttffiles you no longer use.

Step 3: Update license file
In the app.dart file, update the license file name in the google_fonts section with the name of the new file you have added.

Step 4: Set the Font in the App Theme
Open lib/app/app.dart, find GoogleFonts.poppinsTextTheme and replace poppins with your font's name, starting with a lowercase letter:
textTheme:
GoogleFonts.robotoTextTheme(Theme.of(context).textTheme),
| Font on Google Fonts | Write it as |
|---|---|
| Roboto | GoogleFonts.robotoTextTheme |
| Open Sans | GoogleFonts.openSansTextTheme |
| Nunito | GoogleFonts.nunitoTextTheme |
Step 5: Verify Font in pubspec.yaml
The app is pre-configured to use Google Fonts. Ensure the google_fonts package is listed in your pubspec.yaml:
dependencies:
google_fonts: ^latest_version
If not present, add it and run:
flutter pub get
Step 6: Rebuild the App
After updating the font family name, rebuild your app to see the changes:
flutter clean
flutter pub get
flutter run
The new font is applied throughout the app.
✨ How It Works
The app uses the google_fonts package, which:
- Uses the font files in
google_fonts/when they match the font you set, so the app works offline from the first launch - Downloads a font from Google Fonts on first use only when its files are not bundled, then caches it
- Applies the font across all text widgets in the app
💡 Popular Google Fonts
Here are some recommended fonts for educational apps:
- Poppins - Modern, clean, and highly readable
- Roboto - Professional and versatile (Android default)
- Open Sans - Friendly and clear for all screen sizes
- Lato - Elegant and easy to read
- Montserrat - Bold and contemporary
- Nunito - Rounded and approachable
📝 Important Notes
- Font Name Accuracy: Ensure the font family name matches exactly as shown on Google Fonts (case-sensitive)
- Bundle the files: With the
.ttffiles ingoogle_fonts/, the font works without internet. Without them, the first run needs internet to download it - Compatibility: All Google Fonts are optimized for mobile devices
- Testing: Always test your chosen font on different screen sizes and devices
⚠️ Troubleshooting
Font Not Changing?
- Check Font Name: Verify the exact spelling and capitalization on Google Fonts
- Clean Build: Run
flutter clean && flutter pub get - Rebuild App: Ensure you completely rebuild the app, not just hot reload
- Internet Connection: Make sure the device has internet on first run with new font
Font Looks Incorrect?
- Some fonts may not support all language characters
- Test with your app's content to ensure proper rendering
- Consider font weights and styles for better readability
🎨 Custom Fonts (Alternative Method)
If you prefer to use custom fonts not available on Google Fonts:
Step 1: Add Font Files
Place your custom font files (.ttf or .otf) in:
assets/fonts/YourFontName-Regular.ttf
assets/fonts/YourFontName-Bold.ttf
Step 2: Update pubspec.yaml
flutter:
fonts:
- family: YourFontName
fonts:
- asset: assets/fonts/YourFontName-Regular.ttf
- asset: assets/fonts/YourFontName-Bold.ttf
weight: 700
Step 3: Rebuild
flutter clean
flutter pub get
flutter run
🔗 Resources
- Google Fonts - Browse available fonts
- google_fonts Package - Package documentation
- Flutter Typography - Official Flutter font guide